<template>
  <div class="theme-box">
    <i v-show="theme == 'light'" class="icon iconfont icon-sun" type="plain" @click="switchTheme"></i>
    <i v-show="theme == 'dark'" class="icon iconfont icon-moon"></i>
  </div>
</template>

<script setup>
let theme = ref('light');

function switchTheme() {
  theme.value = theme.value == 'light' ? 'dark' : 'light';
}



</script>

<style lang="scss">
.icon{
  margin:0 12px;
  font-size:20px;
}
.icon-moon{
  color:#f00;
}
.theme-box{
  margin-right:36px;
}

</style>
